#ifndef COUNTER_H_
#define COUNTER_H_

#include "io.h"
#include "irq.h"
#include <avr/io.h>


enum CounterMode
{
  FallingEdge = 6,
  RisingEdge = 7
}CounterMode;

typedef struct COUNTER
{
  enum CounterMode CM;
  void (*fHandler)(BYTE Value);
  BYTE SetPoint;
}Counter;

#define HWND_COUNTER0 6
#define HWND_COUNTER1 7

void startCounter0(Counter *C);

extern void start8BitCounter();
extern void start16BitCounter();
extern void on8BitCounter_Overflow(void (*pHandler));
extern void on16BitCounter_Overflow(void (*pHandler));


#endif /*COUNTER_H_*/
